<script type="text/javascript">
window.history.forward(1);
</script>
<a href="/order/list" ><div class="topBack"><img src="/images/back_jiantou.png" style="width:40px;height:40px;"></div></a>
<div class="topContent">订单详情</div>
<div class="topRight" >
<?php
$res = $this->res;
if(($res->status == '2' || $res->status == '3') && $res->sale_channel =='1003') {
	echo 
	'<form action="/share/index" method="post">
		<input type="hidden" name="orderId" value="'.$this->oid.'">
		<input type="hidden" name="mobile" value="'.$this->tel.'">
		<input type="submit" value="分享" style="color:white;">
	</form>';
} else {
	echo '&nbsp';
}
?>
</div>
<div class="clear"></div>

<table class="de_title">
	<tr>
		<td class="green_css"><a href="/order/status?oid=<?php echo $this->oid;?>">订单状态</a></td>
		<td><a href="/order/details?act=list&oid=<?php echo $this->oid;?>">订单信息</a></td>
	</tr>
</table>
<div class="beijin"></div>
<div id="wrapperStatus" class="wrapperComman">
<div style="width:100%;">
<?php  
//订单状态（0系统新生成订单，1 待确认 2 已确认 3 已完成 4 商户取消 5 用户取消 6 过期 7 已点评）
	if(empty($res)){
		$this->_redirect('/error');
	}
	$orderid = $res->id;
	$ordercode = $res->ordercode;
	$tel = $this->tel;
	$status = $res->status;
	$payment = $res->payment;//payment 1 到付  2 在线 
	$has_paid = $res->has_paid;//0,1
	$has_dispatched = $res->has_dispatched;//0未出发，1出发  商户确认
	$has_deliveried =$res->has_deliveried;//0送货未完成  1送货已完成   用户确认
	$isappraise = $res->isappraise;//0,1
	$inserttime = $res->inserttime;
	$svtime = $res->svtime;
?>
<div id="kongdiv" style="background:#F2F2F2;">
	<div class="sta_code">订单编号：<?php echo $ordercode;?></div>
	<?php 
		foreach($res->statusList as $k=> $r){
			echo '
				<div class="sta_left" style="height:68px;">';
					if($k!=0){
						echo '<img src="/images/shuxian.jpg" style="height:30px;"><br>';
						echo '<img src="'.$r->img_url.'">';
					}else{
						echo '<img src="'.$r->img_url.'" style="padding-top:30px;">';
					}
			echo'
				</div>
				<div class="sta_right" style="line-height:25px;margin-top:18px;">
					<div style="padding-left:15px;float:left;width:40%;font-size:0.95em;">'.$r->title.'</div>
					<div style="padding-left:15px;float:left;width:60%;color:#838383;font-size:0.85em;text-align:right;padding-right:5px;">'.$r->inserttime.'</div>
					<div class="clear"></div>
					<div class="subTitle" style="padding-left:15px;color:#838383;font-size:0.85em;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;">'.$r->subTitle.'</div>
				</div>
				<div class="clear"></div>
			';
		}
	?>
	<div style="height:40px;">&nbsp;</div>
	
</div>
 </div>
</div>
<?php 
if(!empty($res->actionList)){
	echo '
<div style="border-top:1px solid grey;width:100%;position:fixed;bottom:0px;left:0;height:60px;_position:fixed;text-align:center;background-color:white;">
	<div style="max-width:640px;margin:0px auto;text-align:center;margin-top:15px;">
		<ul style="text-align:center;">';
		
				foreach($res->actionList as $k=> $r){
					if($k>1)
						break;
					$title = $r->title;
					$action = $r->action;
					if($action=='cancel'){
						echo '<a href="javascript:if(confirm(\'亲，确认取消吗？取消了就吃不到好吃的了!\')) location= \'/order/details?oid='.$this->oid.'&act=cancel\'"><li style="display:inline;padding:6px 25px;color:white;background-color:#38B801;border-radius:2px;margin-left:10px;">'.$title.'</li></a>';
					}else if($action=='confirm'){
						echo '<a href="/order/details?oid='.$this->oid.'&act=confirm"><li style="display:inline;padding:6px 25px;color:white;background-color:#38B801;border-radius:2px;margin-left:10px;">'.$title.'</li></a>';
					}else if($action=='promptlypay'){
						echo '<a href="/order/pay?oid='.$this->oid.'"><li style="display:inline;padding:6px 25px;color:white;background-color:#38B801;border-radius:2px;margin-left:10px;">'.$title.'</li></a>';
					}else if($action=='telreminder'){
						 echo '<a href="javascript:alert(\'请致电021-54573620\');"><li style="display:inline;padding:6px 25px;color:white;background-color:#38B801;border-radius:2px;margin-left:10px;">'.$title.'</li></a>';
					}else if($action=='again'){
						echo '
						<a href="javascript:void();" onclick="buyAgain();return false;"><li style="display:inline;padding:6px 25px;color:white;background-color:#38B801;border-radius:2px;margin-left:10px;">'.$title.'</li></a>';
					}
				}
			echo '		
				</ul>
			</div>
		 </div>';
}
?>
		


<script type="text/javascript"> 
$(document).ready(function() {
		$('.wrapperComman').css('top','85px');
		$('.wrapperComman').css('bottom','60px');
		var myScroll;
		myScroll = new iScroll('wrapperStatus', { scrollbarClass: 'myScrollbar' });
	});

function buyAgain(){
	setCookie('tab','category');
	location.href="/";
}
function getWinHeight(){
	var winHeight='';
	if (window.innerHeight)
		winHeight = window.innerHeight;
	else if ((document.body) && (document.body.clientHeight))
		winHeight = document.body.clientHeight;
	return winHeight;
}
var h = getWinHeight()+300;
// $('#kongdiv').css('height',h);
</script>
